{=caption({=lang(L_NEW_ENTRY)})}
{=sidebar(add_tags.php,add_topics.php,select_dates.php)}
{=breadcrumbs(<a href="?module=admin">{=lang(L_ADMIN_PANNEL)}</a> » {=lang(L_NEW_ENTRY)})}
<form method="post" name="new_post" id="new_post" action="index.php?module=admin&file=newpost.tpl&id={LAST_ID}">

<div class="description-form">

{=lang(L_POST_TITLE)}
<input type="text" class="big-form-title" name="post_title" value="{POST_TITLE}" />
</div>

<div class="description-form">
<textarea name="post_content" id="post_content" rows="10" class="big-form-content">{POST_CONTENT}</textarea>
</div>


<div class="box-a">
  <div class="box-a-head" onclick="toggle_box('post_excerpt_content_arrow','post_excerpt_content');">
    {=lang(L_EXCERPT)}
    <div class="arrow_big">
      <img id="post_excerpt_content_arrow" src="modules/admin/media/icon-down.gif" />
    </div>
  </div>
  <div class="box-a-content" id="post_excerpt_content" style="display:none;">
    <div class="description-form">
      <textarea name="post_excerpt" id="post_excerpt" style="width:100%;" class="big-form-content">{POST_EXCERPT}</textarea>
    </div>
  </div>
</div>


<div class="box-a">
  <div class="box-a-head" onclick="toggle_box('post_footer_content_arrow','post_footer_content');">
    {=lang(L_POST_FOOTER)}
    <div class="arrow_big">
      <img id="post_footer_content_arrow" src="modules/admin/media/icon-down.gif" />
    </div>
  </div>
  <div class="box-a-content" id="post_footer_content" style="display:none;">
    <div class="description-form">
      <textarea name="post_footer" id="post_footer" style="width:100%;" class="big-form-content">{POST_FOOTER}</textarea>
    </div>
  </div>
</div>

<div class="box-a">
  <div class="box-a-head" onclick="toggle_box('custom_fields_content_arrow','custom_fields_content');">
    {=lang(L_CUSTOM_FIELDS)}
    <div class="arrow_big">
      <img id="custom_fields_content_arrow" src="modules/admin/media/icon-down.gif" />
    </div>
  </div>
  <div class="box-a-content" id="custom_fields_content" style="display:none;">
    <div class="box-upload">
      {=lang(L_NAME)}:
      <input name="custom_field_name" type="text" class="field-form" id="custom_field_name" />
    </div>
    <div class="box-upload">
      {=lang(L_VALUE)}:
      <input name="custom_field_value" type="text" class="field-form" id="custom_field_value" /><input type="button" onclick="add_custom_field();" class="button-form-2" id="button" value="{=lang(L_ADD)}" />
    </div>
    <div class="box-upload">
      <div id="custom_field_names">
	{HOLD_CUSTOM_FIELD_NAMES}
      </div>
    </div>
    <div class="box-upload">
      <div id="custom_field_values">
	{HOLD_CUSTOM_FIELD_VALUES}
      </div>
    </div>
    <input type="hidden" name="list_custom_field_names" id="list_custom_field_names" value="{CUSTOM_FIELD_NAMES}" />
    <input type="hidden" name="list_custom_field_values" id="list_custom_field_values" value="{CUSTOM_FIELD_VALUES}" />
  </div>
</div>
<script type="text/javascript">
        var $array = $('list_custom_field_names').value.split(",");
      for (var $i = 0; $i < $array.length-1; $i++){
	 $names = $('list_custom_field_names').value;
	 new Ajax.InPlaceEditor('custom_field_name'+$array[$i], 'modules/admin/controllers/inc/inplaceeditor.php', { callback: function(form, value) { return 'value='+value+'&type=names&all_values='+escape($('list_custom_field_names').value) } });
      }

      var $array = $('list_custom_field_values').value.split(",");
      for (var $i = 0; $i < $array.length-1; $i++){
	 $values = $('list_custom_field_values').value;
	 new Ajax.InPlaceEditor('custom_field_value'+$array[$i], 'modules/admin/controllers/inc/inplaceeditor.php',{ callback: function(form, value) { return 'value='+value+'&type=values&all_values='+escape($('list_custom_field_values').value) } });
      }
</script>


<div id="buttons-post">
<div onclick="submit_post_form(1);" class="publish">{=lang(L_PUBLISH)}</div>

<div onclick="submit_post_form(0);" class="save">{=lang(L_SAVE)}</div>

</div>
<input type="hidden" id="status" name="status" value="1" />
<script type="text/javascript">
  load_editor('post_content');
</script>